unit rapidharkdb;

interface

uses
  SysUtils, Classes, DB, nxdb, nxsdServerEngine, nxreRemoteServerEngine,
  nxllComponent, nxllTransport, nxptBasePooledTransport,
  nxtmSharedMemoryTransport, nxsrSqlEngineBase, nxsqlEngine, nxsrServerEngine,
  nxseAutoComponent, JvComponentBase, JvSearchFiles;

type
  TrhDB = class(TDataModule)
    nxSession1: TnxSession;
    nxDatabase1: TnxDatabase;
    artists: TnxTable;
    albums: TnxTable;
    tracks: TnxTable;
    files: TnxTable;
    artistsDS: TDataSource;
    albumsDS: TDataSource;
    tracksDS: TDataSource;
    filesDS: TDataSource;
    artistsrecnum: TAutoIncField;
    artistsfirst: TStringField;
    artistslast: TStringField;
    artistsartistid: TIntegerField;
    artistsupdated: TDateTimeField;
    albumsrecnum: TAutoIncField;
    albumspubdate: TDateField;
    albumsartistid: TIntegerField;
    albumsalbumid: TIntegerField;
    albumstitle: TStringField;
    albumsgenre: TStringField;
    albumsupdated: TDateTimeField;
    filesrecnum: TAutoIncField;
    filesmedia: TBlobField;
    filesfileid: TIntegerField;
    filesupdated: TDateTimeField;
    nxServerEngine1: TnxServerEngine;
    nxSqlEngine1: TnxSqlEngine;
    nxseAllEngines1: TnxseAllEngines;
    nxSharedMemoryTransport1: TnxSharedMemoryTransport;
    nxRemoteServerEngine1: TnxRemoteServerEngine;
    tracksrecnum: TAutoIncField;
    trackstitle: TWideStringField;
    tracksalbumid: TIntegerField;
    tracksfileid: TIntegerField;
    tracksfilename: TWideStringField;
    tracksfilepath: TWideStringField;
    tracksupdated: TDateTimeField;
    JvSearchFiles1: TJvSearchFiles;
    nxTable1: TnxTable;
    AutoIncField1: TAutoIncField;
    WideStringField1: TWideStringField;
    IntegerField1: TIntegerField;
    IntegerField2: TIntegerField;
    WideStringField2: TWideStringField;
    WideStringField3: TWideStringField;
    DateTimeField1: TDateTimeField;
    procedure tracksBeforePost(DataSet: TDataSet);
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  rhDB: TrhDB;

implementation

{$R *.dfm}

procedure TrhDB.DataModuleCreate(Sender: TObject);
begin
//nxDataBase1.AliasPath:=ExtractFilePath(paramStr(0))+'\db';
end;

procedure TrhDB.tracksBeforePost(DataSet: TDataSet);
begin
dataset.FieldByName('updated').AsDateTime := now;
end;

end.
